<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>angularJS-demo8-内置服务</title>
		<script src="angular.min.js"></script>
		<script>
			var app = angular.module("myApp",[]);
			app.controller("myController",function($scope, $http){
				
				$scope.findList = function() {
					$http.get("data.json").success(function(response){
						$scope.list = response.data;
					});
				}
			});
		</script>
	</head>
	<body ng-app="myApp" ng-controller="myController" ng-init="findList()">
		<table>
			<tr>
					<th>姓名</th>
					<th>数学</th>
					<th>语文</th>
			</tr>
			<tr ng-repeat="entity in list">
				<td>{{entity.name}}</td>
				<td>{{entity.math}}</td>
				<td>{{entity.chinese}}</td>
			</tr>
		</table>
	</body>
</html>
